/**
 * Created by dell on 2018/4/16.
 */
// 提示框配置
var toastrCog = {
    cog: function () {
        toastr.options = {
            "closeButton": true,
            "debug": true,
            "progressBar": true,
            "positionClass": "toast-top-right",
            "showDuration": "200",
            "hideDuration": "500",
            "timeOut": "10000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeInDown",
            "hideMethod": "fadeOutUp"
        }
    },
    success: function (html, time) {
        if (time == null || time == "")
            time = 10000;
        toastr.options = {
            "timeOut": time,
            "closeButton": true,
            "positionClass": "toast-top-center",
            "hideDuration": "500"
        };
        toastr.success(html);

    },
    warning: function (html, time) {
        if (time == null || time == "")
            time = 10000;
        toastr.options = {
            "timeOut": time,
            "closeButton": true,
            "positionClass": "toast-top-center",
            "hideDuration": "500"
        };
        toastr.warning(html);

    },
    error: function (html, time) {
        if (time == null || time == "")
            time = 5000;
        toastr.options = {
            "timeOut": time,
            "closeButton": true,
            "positionClass": "toast-top-center",
            "hideDuration": "500"
        };
        if($("body .toast-message").html()==html){
            $(".toast-error").remove();
        }
        toastr.error(html);

    }
};
